package com.ssy.lingxi.pay.entity;

import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @Description: 建行交易流水表
 * @Author: HuangJieZhou
 * @Date: 2021/12/22 11:29
 * @Version: 2.0.0
 **/
@Data
@Entity
@Table(schema = "public", name = "pay_ccb_tran_record")
public class CcbTranRecordDO implements Serializable {
    private static final long serialVersionUID = -1337289377835502577L;
    /**
     * 主键id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "pay_ccb_tran_record_seq")
    @SequenceGenerator(sequenceName = "pay_ccb_tran_record", name = "pay_ccb_tran_record", allocationSize = 1)
    private Long id;
    /**
     * 商户代码（客户号）
     */
    @Column(columnDefinition = "varchar(21)")
    private String merchantId;
    /**
     * 商户柜台代码
     */
    @Column(columnDefinition = "varchar(9)")
    private String posId;
    /**
     * 分行代码
     */
    @Column(columnDefinition = "varchar(9)")
    private String branchId;
    /**
     * 订单号（支付订单号）
     */
    @Column(columnDefinition = "varchar(30)")
    private String orderId;
    /**
     * 币种
     */
    @Column(columnDefinition = "varchar(2)")
    private String curCode;
    /**
     * 交易码
     */
    @Column(columnDefinition = "varchar(6)")
    private String txCode;
    /**
     * 备注1
     */
    @Column(columnDefinition = "varchar(32)")
    private String remark1;
    /**
     * 备注2
     */
    @Column(columnDefinition = "varchar(32)")
    private String remark2;
    /**
     * 订单超时时间
     */
    @Column(columnDefinition = "varchar(14)")
    private String timeout;
    //回调参数
    /**
     * 付款客户号（客户网银识别号）
     */
    @Column(columnDefinition = "varchar(20)")
    private String custId;
    /**
     * 付款账户名称
     */
    @Column(columnDefinition = "varchar(40)")
    private String accNo;
    /**
     * 支付结果（2-成功 5-失败 6-不确定）
     */
    @Column(columnDefinition = "varchar(1)")
    private String status;
    /**
     * 付款方式（N-对公账户支付）
     */
    @Column(columnDefinition = "varchar(1)")
    private String tranFlag;
    /**
     * 交易时间
     */
    @Column(columnDefinition = "varchar(12)")
    private String tranTime;
    /**
     * 分行名称
     */
    @Column(columnDefinition = "varchar(40)")
    private String branchName;
    /**
     * 支付订单创建时间
     */
    @Column
    private LocalDateTime createTime;

    /**
     * 是否接受到回调（0-否 1-是）
     */
    @Column(columnDefinition = "int2")
    private Short ifCallback;

    /**
     * 透传参数，在回调通知中原样返回
     */
    @Column(columnDefinition = "varchar(255)")
    private String attach;
}
